package Day16;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class Demo10 {
    public static void main(String[] args) throws IOException {
        //转换流
        //将字节流  转换（装饰）为 字符流
        FileInputStream fis = new FileInputStream("C:\\Users\\刘娟\\Desktop\\aa.txt");
        //参数1：要转化的字节流
        //参数2：指定编码名称
        InputStreamReader isr = new InputStreamReader(fis,"UTF-8");
        while(true) {
            int b = isr.read();
            if(b == -1){
                break;
            }
            System.out.println((char)b);
        }
    }
}
